# -*- coding: utf-8 -*-
__all__ = ('ResponseError', )

class EstraierError(Exception):
    """
    Base exception class for estrairerpure
    """

class ResponseError(EstraierError):
    """
    Indicates invalid responses from a Hyper Estraier node.
    """
    def __init__(self, code, reason):
        EstraierError.__init__(self)
        self.code = code
        self.reason = reason

    def __repr__(self):
        return '<estrairerpure.exceptions.%s "%s %s">' % (self.__class__.__name__, self.code, self.reason)

    def __str__(self):
        return repr(self)

class NodeNotFoundError(ResponseError):
    pass

class AuthorizationError(ResponseError):
    pass
